<?=$this->doctype(); ?>
<html>
	<head>
        <?=$this->headMeta(); ?>
		<?=$this->headTitle(); ?>
        <?=$this->headLink(); ?>
        <?=$this->headScript(); ?>
	</head>
	<body>
		<div id="content">
			<div id="header">
                <div id="search">
                    <span class = "search_title">Search:</span>
                    <input type="text" class="search_text" name="search" id="search_text" />
                    <select id="search_area" class="search_field">
                        <option value="spa">devices</option>
                        <option value="account">accounts</option>
                        <option value="type">types</option>
                        <option value="companies">companies</option>
                    </select>
                    <button onClick="doSearch(document.getElementById('search_text').value, document.getElementById('search_area').value, 'search_results_field');">Go!</button>
                </div>
                <a href="/"><div id="logo" class="left"></div></a>
                <div id="auth" class="right">
<?
    $user_info = Zend_Auth::getInstance()->getIdentity();
    $model_user = Principio_Model_UserMapper::fetch($user_info["user_id"]);
?>
                    <span class="cur_user"><?=$model_user->getLogin(); ?></span>
                    &nbsp;<a href="<?=$this->url(['controller' => "auth", 'action' => "logout"]); ?>">(Logout)</a>
                </div>
                <div class="clear"></div>
			</div>
            <div id="main_menu">
                <?=$this->partial("main_menu.tpl"); ?>
            </div>
			<div id="center">
                <div id="right_work_area" class="left">
					<div id="inner">
						<h1><?=$this->title; ?></h1>
						<?=$this->layout()->content; ?>
					</div>
					<div id="search_results">
						<div id="search_results_field"></div>
						<div id="search_show_btn">Скрыть/показать результаты поиска</div>
					</div>
				</div>
                <div id="left_tree" class="left">
<?
    $controller_name = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
    echo ($controller_name == "admin") ? $this->partial("admin_menu.tpl") : $this->partial("menu.tpl");
?>
				</div>
			</div>
			<div class="empty"></div>
		</div>
		<div id="footer">
			<div id="copyright">
				Principio v0.3.0&nbsp;&nbsp;&nbsp;Copyright © 2011 - 2012 Principio Lab
			</div>	
		</div>
    </body>
</html>